<template>
	<div>
		<el-table
			:data="info" 
			:header-cell-style="{ 'text-align': 'center' }" 
			:cell-style="{ 'text-align': 'center' }" 
			class="w-full"
		>
			<el-table-column prop="active_num" :label=" $t('marketing.guess.drawsNum')" show-overflow-tooltip />
			<el-table-column prop="active_type" :label="$t('marketing.guess.type')" show-overflow-tooltip >
                <template #default="scope">
						{{ setActive_type(scope.row) }}
					</template>
            </el-table-column>
			<el-table-column prop="gifts_num" :label="$t('marketing.guess.giftNum')" show-overflow-tooltip />
			<el-table-column prop="designated_gift" :label="$t('marketing.guess.giftRewards')" show-overflow-tooltip />
		</el-table>
	</div>
</template>

<script lang="ts" setup>
import { useI18n } from 'vue-i18n' 
const { t: $t } = useI18n()
	let props = defineProps({
		info: {
			// 主体数据
			type: Array,
			default: []
		}
	})
    let setActive_type = (row)=>{
        if(row.active_type == 1){
            row.active_typeCn = $t('marketing.guess.Single')
        }
        if(row.active_type == 2){
            row.active_typeCn = $t('marketing.guess.continuous')
        }
        return row.active_typeCn
    }
</script>
